home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / PCHDT_E3.CAB / HCsrc_03.js < prev    next >
Encoding:
JavaScript  |  2003-02-21  |  3.4 KB  |  95 lines

  1. //
  2. // Copyright (c) 2001 Microsoft Corporation
  3. //
  4.  
  5. function Desktop_Generate()
  6. {
  7.     try
  8.     {
  9.         var query = [];
  10.         var image = [];
  11.         var i     = 0;
  12.  
  13.         image['TopLevelBucket_1'] = "hcp://system/images/48x48/desktop_icon_01.bmp";
  14.         image['TopLevelBucket_2'] = "hcp://system/images/48x48/desktop_icon_02.bmp";
  15.         image['TopLevelBucket_3'] = "hcp://system/images/48x48/desktop_icon_03.bmp";
  16.         image['TopLevelBucket_4'] = "hcp://system/images/48x48/desktop_icon_04.bmp";
  17.  
  18.         var html = "<TABLE border=0 cellPadding=8 cellSpacing=0>";
  19.         var qrc = pchealth.Database.LookupSubNodes( "", true );
  20.         for(var e = new Enumerator( qrc ); !e.atEnd(); e.moveNext())
  21.         {
  22.             var qr  = e.item();
  23.             var img;
  24.  
  25.             if(qr.IconURL) img = qr.IconURL;                                            // use the bucket icon if one is present in the database
  26.             else           img = "hcp://system/images/48x48/desktop_icon_generic.bmp"; // use a generic icon
  27.  
  28.             if(image[qr.Entry]) img = image[qr.Entry];
  29.  
  30.             html += "<TR>";
  31.             html += "<TD VALIGN=middle style='margin; 4px; padding-bottom: 20px'>";
  32.  
  33.             if(img.match( /\.bmp$/i ))
  34.             {
  35.                 html += "<helpcenter:bitmap style='width: 48px; height: 48px' srcNormal=\"" + pchealth.TextHelpers.QuoteEscape( img ) + "\"></helpcenter:bitmap>";
  36.             }
  37.             else
  38.             {
  39.                 html += "<DIV style='width: 48px; height: 48px; font-size: 1px'><img style='width: 48px; height: 48px' src=\"" + pchealth.TextHelpers.QuoteEscape( img ) + "\"></DIV>";
  40.             }
  41.             html += "</TD><TD style='padding-bottom: 20px'><TABLE border=0 cellPadding=0 cellSpacing=0>";
  42.  
  43.             var qrc2 = pchealth.Database.LookupSubNodes( qr.FullPath, true );
  44.             for(var e2 = new Enumerator( qrc2 ); !e2.atEnd(); e2.moveNext())
  45.             {
  46.                 var qr2        = e2.item();
  47.                 var strURL     = pchealth.TextHelpers.QuoteEscape( qr2.TopicURL    );
  48.                 var strTitle   = pchealth.TextHelpers.HTMLEscape ( qr2.Title       );
  49.                 var strToolTip = pchealth.TextHelpers.QuoteEscape( qr2.Description );
  50.  
  51.                 html += "<TR class='sys-font-body-bold' style='padding-bottom : .5em' HC_FULLPATH='" + qr2.FullPath + "' HC_TOPIC=\"" + strURL + "\"><TD VALIGN=TOP><LI></TD>";
  52.                 html += "<TD><A class='sys-link-homepage' TITLE=\"" + strToolTip + "\" HREF='none'>" + strTitle + "</A></TD></TR>";
  53.             }
  54.  
  55.             html += "</TABLE></TD></TR>";
  56.         }
  57.         html += "</TABLE>";
  58.  
  59.         idTaxo.innerHTML = html;
  60.  
  61.         var tbl = idTaxo.firstChild;
  62.         for(i=0;i<tbl.rows.length; i++)
  63.         {
  64.             var tbl2 = tbl.rows(i).cells(1).firstChild;
  65.             for(j=0;j<tbl2.rows.length; j++)
  66.             {
  67.                 var row = tbl2.rows(j);
  68.  
  69.                 row.onclick = Desktop_ShowContent;
  70.             }
  71.         }
  72.     }
  73.     catch(e)
  74.     {
  75.     }
  76.  
  77.     idTopLevelTable.style.display = "";
  78. }
  79.  
  80. function Desktop_ShowContent()
  81. {
  82.     Common_CancelEvent();
  83.  
  84.     try
  85.     {
  86.         if(this.HC_FULLPATH && pchealth.HelpSession.IsNavigating() == false)
  87.         {
  88.             pchealth.HelpSession.ChangeContext( "SubSite", this.HC_FULLPATH, this.HC_TOPIC );
  89.         }
  90.     }
  91.     catch(e)
  92.     {
  93.     }
  94. }
  95.